<script lang="ts">
  import { getStyle } from '../tools/base'
  export let cardList = [
    { id: 1, name: "", icon: "", forces: '1' },
    { id: 2, name: "", icon: "", forces: '2' },
  ];

</script>

<div class="wrap">
  {#each cardList as card}
    <div class="card" style={getStyle(card)}>{card.id}</div>
  {/each}
</div>

<style lang="less">
  .wrap {
    width: 100vw;
    position: fixed;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    padding: 12px 100px;
    perspective: 1200px;
    perspective-origin: center;
    transform-style: preserve-3d;

    .card {
      width: 150px;
      height: 200px;
      box-sizing: border-box;
      border-radius: 8px;
      cursor: pointer;
      border: 1px solid #00f;
      background-color: #eee;
      transform-origin: left;
      transform: rotateY(90deg);
      transition: 1s;
      position: absolute;
      bottom: 0;
      z-index: 100;

      &:hover {
        transform: scale(1.5) translateY(-100px);
        z-index: 200;
      }
    }
  }
</style>
